package com.vertx.core.http;

import io.vertx.core.Vertx;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.http.HttpVersion;

/**
 * @version v1.0
 * @Description: TODO(一句话描述该类的功能)
 * @Author: TongRui乀
 * @Date: 2021/5/11 10:44 上午
 */
public class HttpClientService {

    public static void main(String[] args) {
        HttpClientOptions options = new HttpClientOptions().
                setProtocolVersion(HttpVersion.HTTP_2).
                setSsl(true).
                setUseAlpn(true).
                setTrustAll(true);

        HttpClient client = Vertx.vertx().createHttpClient(options);

        client.request(HttpMethod.GET, 8080, "127.0.0.1", "", clientRequest->{
            if (clientRequest.succeeded()) {
                System.out.println("send success");
            }
        });
    }

}
